home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-1097 / AMOSLIST / text0063.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  3.8 KB  |  135 lines

  1. Im having a problem with AMOSPro, and I dont know if it is the Pro editor
  2. itself, or something in the GUI extension that is affecting it.
  3.  
  4. The problem is quite simple. My source code is being tampered with. Im
  5. using a procedure which executes a DOS command, and sends its output to a
  6. window which I define. Its not a GUI extension window, either. I'll rip the
  7. source code for the procedures im using, and be right back... OK Here they
  8. are:
  9.  
  10. Procedure WCL[N]
  11.    ' This procedure closes a window I have opened
  12.    If WINCON(N)=0 Then Goto ERR
  13.    Dreg(1)=WINCON(N)
  14.    X=Doscall(-36)
  15.    If X=0
  16.       Goto ERR
  17.    End If 
  18.    Pop Proc
  19.    ERR:
  20.    ERR=Doscall(-132)
  21.    '   System 
  22.    End 
  23. End Proc
  24.  
  25. Procedure WEX[N,COM$]
  26.    ' This procedure will execute a DOS command in COM$ and send the output
  27.    ' To Window (N)
  28.    If WINCON(N)=0 Then Goto ERR
  29.    Dreg(1)=Varptr(COM$)
  30.    Dreg(2)=0
  31.    Dreg(3)=WINCON(N)
  32.    X=Doscall(-222)
  33.    If Len(COM$)>0
  34.       V=Varptr(COM$)
  35.       For ZZ=0 To Len(COM$)-1 : Poke ZZ+V,0 : Next ZZ
  36.    End If 
  37.    If X=0
  38.       Goto ERR
  39.    End If 
  40.    Pop Proc
  41.    ERR:
  42.    ERR=Doscall(-132)
  43. End Proc
  44.  
  45. Procedure WOP[N,X,Y,XX,YY,NAME$]
  46.    ' This opens a CLI window XX=Width  YY=Height  NAME$=Title
  47.    X$=Str$(X)-" "
  48.    Y$=Str$(Y)-" "
  49.    XX$=Str$(XX)-" "
  50.    YY$=Str$(YY)-" "
  51.    CON$="CON:"+X$+"/"+Y$+"/"+XX$+"/"+YY$+"/"+NAME$
  52.    CON$=CON$+Chr$(0)
  53.    Dreg(1)=Varptr(CON$)
  54.    Dreg(2)=1005
  55.    WINCON(N)=Doscall(-30)
  56.    If WINCON(N)=0
  57.       ERR=Doscall(-132)
  58.       'System  
  59.       End 
  60.    End If 
  61. End Proc
  62.  
  63. Procedure WPR[N,M$]
  64.    ' This prints the text in M$ to Window (N)
  65.    If WINCON(N)=0 Then Goto ERR
  66.    Dreg(1)=WINCON(N)
  67.    Dreg(2)=Varptr(M$)
  68.    Dreg(3)=Len(M$)
  69.    X=Doscall(-48)
  70.    If X=0
  71.       Goto ERR
  72.    End If 
  73.    Pop Proc
  74.    ERR:
  75.    ERR=Doscall(-132)
  76.    WCL[1]
  77.    '  System  
  78.    End 
  79. End Proc
  80.  
  81. OK, the above procedures are the ones which involve the CLI tasking which I
  82. am/was using in my program. The below procedure is one of the ones which
  83. are seriously affected by the problem...
  84.  
  85. Procedure _GETNEWS
  86.    ' Executes the AREXX script which will grab the news for the user. 
  87.    
  88.    If Not Exist("Mailserv:REXX/NNTPTransfer") : Rem News Recovery Program
  89.       SEL=Gui Req("News Recovery Error...","Cannot find news recovery
  90. script."+Chr$(10)+"Please check you installed program correctly","OK")
  91.       Pop Proc
  92.    End If 
  93.    
  94.    ' Open up a CLI window and grab the news!
  95.    Proc WOP[2,50,50,540,100,"Mailinglist Manager Output..."]
  96.    Proc WPR[2,"Attempting to Execute News Recovery script"+Chr$(10)+Chr$(10)]
  97.    Proc WEX[2,"SYS:REXXC/Rx Mailserv:REXX/NNTPTransfer"]
  98.    Wait 200
  99.    WCL[2]
  100. End Proc
  101.  
  102. Now, the real problem is the fact that the routine is deleting the contents
  103. of the WEX[""] line, no matter where i run it from, and no matter what is
  104. in it, when I go back to source format, the line will read:
  105.  
  106.    Proc WEX["
  107.  
  108. Thats it, it misses a quote, and a square bracket. The wierdest thing, is
  109. it tests OK, and will run again, but the contents that were in it are
  110. annulled and doesnt pass any commands to the CLI apart from a ""
  111.  
  112. Ive never used these procedures in ages, and only after starting using the
  113. GUI extension, am I discovering these wierd effects. Like I said, I dont
  114. know if its AMOSPro, or the GUI Extension.
  115.  
  116. Can anyone here see what is wrong? When the program is compiled, it will
  117. execute the script once, then it annuls itself, and wont close the window
  118. as the system has locked due to the error. I really ned to send the output
  119. of a program to a window though. Please help me!!!!
  120.  
  121. Andrew "Mushroom" Kellett
  122.  
  123. P.S. Sorry for the length of this email!
  124.  
  125. --
  126.  Email: Andy Kellett <mushypd@redrose.net>  Team *AMOS* + IAPA Team *AMIGA*
  127.   alt.religion.amos - AMOS now on usenet! AMOS Mailinglist also mirrored
  128.  
  129.      World's Largest AMOS Homepages - http://www.mushy-pd.demon.co.uk
  130.  
  131.          Massive FTP site with AMOS/C64 and Mods/Samples + more at
  132.                             mushy-pd.dyn.ml.org
  133.  
  134.  
  135.